// 搜索
import request from '@/utils/request.js'
import store from '@/store'
// 获取搜索结果
export const getSearchResultAPI = ({ q, page }) => {
  return request({
    url: '/v1_0/search',
    params: {
      q,
      page
    }
  })
}

// 不感兴趣
export const dislikeAPI = (target) => {
  return request({
    url: '/v1_0/article/dislikes',
    method: 'POST',
    headers: {
      Authorization: 'Bearer ' + store.state.token
    },
    data: {
      target: target
    }
  })
}
// 反馈内容
export const responentAPI = (target, type, remark) => {
  return request({
    url: '/v1_0/article/reports',
    method: 'POST',
    headers: {
      Authorization: 'Bearer ' + store.state.token
    },
    data: {
      target: target,
      type: type,
      remark: remark
    }
  })
}

// 获取联想菜单
export const suggestAPI = ({ q }) => {
  return request({
    url: '/v1_0/suggestion',
    params: {
      q: q
    }
  })
}
